#ifndef QTPLAYERSSELECTOR_H
#define QTPLAYERSSELECTOR_H

#include <QWidget>
#include <QPainter>
#include "PlayersSelector.h"
#include "QtPlayerEditor.h"
#include "ui_qtplayersselector.h"

class QtPlayersSelector : public QWidget, public PlayersSelector
{
    Q_OBJECT

public:
    QtPlayersSelector(QWidget *parent = 0);
    ~QtPlayersSelector();

	virtual void GetPlayers(unsigned int minPlayerCount, unsigned int maxPlayerCount);
	virtual void paintEvent(QPaintEvent *e);

	void SetPlayerCount(unsigned int newPlayerCount);

private slots:
	void OnPlayerCountChanged(int playerCount);
	void OnConfirm();
	void OnCancel();

private:
	std::list<QtPlayerEditor*> players;
	unsigned int playerCount;

	Ui::QtPlayersSelector ui;
	
};

#endif // QTPLAYERSSELECTOR_H
